package com.example.tranhtheuchuthap;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;



public class Chon_Anh extends Activity  {
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_chonanh);
		Button btn_chup=(Button)findViewById(R.id.btnChup);
		Button btn_gallery=(Button)findViewById(R.id.btnGallery);
		btn_chup.setOnClickListener(onClickListener);
        btn_gallery.setOnClickListener(onClickListener);
        
}

private OnClickListener onClickListener = new OnClickListener() {
	int key=0;
     @Override
     public void onClick(final View v) {
         switch(v.getId()){
             case R.id.btnChup:
                 key =1; //DO something
             break;
             case R.id.btnGallery:
                  key=2;//DO something
             break;
            
         }
Intent i=new Intent();
i.putExtra("key", key);
setResult(RESULT_OK, i);
finish();
   }
};
		
	}

